package com.itheima.workone1111;

public class Clerk extends Employee{
    // 经理属性
    private Manager manager;

    // 空参构造方法
    public Clerk() {}

    // 满参构造方法
    public Clerk(String name, String workId, String dept, Manager manager) {
        super(name, workId, dept);
        this.manager = manager;
    }

    // Getter 和 Setter 方法
    public Manager getManager() {
        return manager;
    }

    public void setManager(Manager manager) {
        this.manager = manager;
    }

    // 重写 showMsg 方法
    @Override
    public void showMsg() {
        System.out.println("职员：");
        System.out.println("姓名为: " + getName());
        System.out.println("工号为: " + getWorkId());
        System.out.println("部门为: " + getDept());
        if (manager != null) {
            System.out.println("他的经理是: " + manager.getName());
        }
    }
}
